package com.ellricky.excute_president.ui.activity.school

import androidx.fragment.app.Fragment
import com.ellricky.baselib.BaseConstant
import com.ellricky.baselib.ui.base.BaseTabVpActivity
import com.ellricky.excute_president.*
import java.util.*

class AchiveActivity : BaseTabVpActivity() {


    private lateinit var flag: String


    override fun initUIView() {
        flag = intent.getStringExtra(BaseConstant.KEY_ID) ?: ""
        super.initUIView()
    }

    override fun getFragmentList(): MutableList<Fragment> {
        val newYj = when (flag) {
            "1" -> API_MONTH_NEW_YEJI
            else -> API_NEW_YEJI
        }

        val xf = when (flag) {
            "1" -> API_MONTH_XF_YEJI
            else -> API_XF_YEJI
        }

        val fragments = ArrayList<Fragment>()
        fragments.add(AchieveFragment.newInstance(newYj))
        fragments.add(AchieveFragment.newInstance(xf))
        return fragments
    }

    override fun getTabTitleList(): MutableList<String> {
        val tList = ArrayList<String>()
        tList.add(getString(R.string.pd_new_yeji))
        tList.add(getString(R.string.pd_xf_yeji))
        return tList
    }

    override fun getTitleRes(): Int {
        return  when (flag) {
            "1" -> R.string.pd_month_yeji
            else -> R.string.pd_today_yeji
        }
    }

}
